Optimal. Leaf size=87 \[ \frac {7 x}{8 a^2}-\frac {2 \sin (c+d x)}{a^2 d}+\frac {7 \cos (c+d x) \sin (c+d x)}{8 a^2 d}+\frac {\cos ^3(c+d x) \sin (c+d x)}{4 a^2 d}+\frac {2 \sin ^3(c+d x)}{3 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3957, 2948,
2836, 2715, 8, 2713} \begin {gather*} \frac {2 \sin ^3(c+d x)}{3 a^2 d}-\frac {2 \sin (c+d x)}{a^2 d}+\frac {\sin (c+d x) \cos ^3(c+d x)}{4 a^2 d}+\frac {7 \sin (c+d x) \cos (c+d x)}{8 a^2 d}+\frac {7 x}{8 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2836
Rule 2948
Rule 3957
Rubi steps
\begin {align*} \int \frac {\sin ^4(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\int \frac {\cos ^2(c+d x) \sin ^4(c+d x)}{(-a-a \cos (c+d x))^2} \, dx\\ &=\frac {\int \cos ^2(c+d x) (-a+a \cos (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (a^2 \cos ^2(c+d x)-2 a^2 \cos ^3(c+d x)+a^2 \cos ^4(c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \cos ^2(c+d x) \, dx}{a^2}+\frac {\int \cos ^4(c+d x) \, dx}{a^2}-\frac {2 \int \cos ^3(c+d x) \, dx}{a^2}\\ &=\frac {\cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^3(c+d x) \sin (c+d x)}{4 a^2 d}+\frac {\int 1 \, dx}{2 a^2}+\frac {3 \int \cos ^2(c+d x) \, dx}{4 a^2}+\frac {2 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a^2 d}\\ &=\frac {x}{2 a^2}-\frac {2 \sin (c+d x)}{a^2 d}+\frac {7 \cos (c+d x) \sin (c+d x)}{8 a^2 d}+\frac {\cos ^3(c+d x) \sin (c+d x)}{4 a^2 d}+\frac {2 \sin ^3(c+d x)}{3 a^2 d}+\frac {3 \int 1 \, dx}{8 a^2}\\ &=\frac {7 x}{8 a^2}-\frac {2 \sin (c+d x)}{a^2 d}+\frac {7 \cos (c+d x) \sin (c+d x)}{8 a^2 d}+\frac {\cos ^3(c+d x) \sin (c+d x)}{4 a^2 d}+\frac {2 \sin ^3(c+d x)}{3 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.37, size = 91, normalized size = 1.05 \begin {gather*} \frac {\cos ^4\left (\frac {1}{2} (c+d x)\right ) \sec ^2(c+d x) \left (84 d x-144 \sin (c+d x)+48 \sin (2 (c+d x))-16 \sin (3 (c+d x))+3 \sin (4 (c+d x))+2 \tan \left (\frac {c}{2}\right )\right )}{24 a^2 d (1+\sec (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 89, normalized size = 1.02
method | result | size |
risch | \(\frac {7 x}{8 a^{2}}-\frac {3 \sin \left (d x +c \right )}{2 a^{2} d}+\frac {\sin \left (4 d x +4 c \right )}{32 a^{2} d}-\frac {\sin \left (3 d x +3 c \right )}{6 a^{2} d}+\frac {\sin \left (2 d x +2 c \right )}{2 a^{2} d}\) | \(73\) |
derivativedivides | \(\frac {\frac {8 \left (-\frac {25 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}-\frac {83 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96}-\frac {77 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96}-\frac {7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{32}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {7 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}}{a^{2} d}\) | \(89\) |
default | \(\frac {\frac {8 \left (-\frac {25 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}-\frac {83 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96}-\frac {77 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96}-\frac {7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{32}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {7 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}}{a^{2} d}\) | \(89\) |
norman | \(\frac {\frac {7 x}{8 a}-\frac {7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}-\frac {77 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}-\frac {83 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}-\frac {25 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a d}+\frac {7 x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {21 x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a}+\frac {7 x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {7 x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} a}\) | \(169\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 206 vs.
\(2 (79) = 158\).
time = 0.48, size = 206, normalized size = 2.37 \begin {gather*} -\frac {\frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {77 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {83 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {75 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{2} + \frac {4 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {4 \, a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {a^{2} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}} - \frac {21 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.13, size = 50, normalized size = 0.57 \begin {gather*} \frac {21 \, d x + {\left (6 \, \cos \left (d x + c\right )^{3} - 16 \, \cos \left (d x + c\right )^{2} + 21 \, \cos \left (d x + c\right ) - 32\right )} \sin \left (d x + c\right )}{24 \, a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sin ^{4}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 87, normalized size = 1.00 \begin {gather*} \frac {\frac {21 \, {\left (d x + c\right )}}{a^{2}} - \frac {2 \, {\left (75 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 83 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 77 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 21 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4} a^{2}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.51, size = 81, normalized size = 0.93 \begin {gather*} \frac {7\,x}{8\,a^2}-\frac {\frac {25\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+\frac {83\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{12}+\frac {77\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12}+\frac {7\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{a^2\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________